home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / fw_perl.idb / usr / freeware / catman / p_man / cat3 / ExtUtils::Embed.Z / ExtUtils::Embed
Encoding:
Text File  |  1998-10-28  |  13.0 KB  |  331 lines

  1.  
  2.  
  3.  
  4.      EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222EEEE))))xxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))
  5.  
  6.  
  7.  
  8.      NNNNAAAAMMMMEEEE
  9.       ExtUtils::Embed - Utilities for embedding Perl in C/C++
  10.       applications
  11.  
  12.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  13.        perl    -MExtUtils::Embed -e xsinit
  14.        perl    -MExtUtils::Embed -e ldopts
  15.  
  16.  
  17.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  18.       ExtUtils::Embed provides utility functions for embedding a
  19.       Perl interpreter and extensions in your C/C++    applications.
  20.       Typically, an    application MMMMaaaakkkkeeeeffffiiiilllleeee will invoke
  21.       ExtUtils::Embed functions while building your    application.
  22.  
  23.      @@@@EEEEXXXXPPPPOOOORRRRTTTT
  24.       ExtUtils::Embed exports the following    functions:
  25.  
  26.       _x_s_i_n_i_t(), _l_d_o_p_t_s(), _c_c_o_p_t_s(),    _p_e_r_l__i_n_c(), _c_c_f_l_a_g_s(),
  27.       _c_c_d_l_f_l_a_g_s(), _x_s_i__h_e_a_d_e_r(), _x_s_i__p_r_o_t_o_s(), _x_s_i__b_o_d_y()
  28.  
  29.      FFFFUUUUNNNNCCCCTTTTIIIIOOOONNNNSSSS
  30.       xsinit()
  31.            Generate    C/C++ code for the XS initializer function.
  32.  
  33.            When invoked as `perl -MExtUtils::Embed -e xsinit --`
  34.            the following options are recognized:
  35.  
  36.            ----oooo <output filename> (Defaults to ppppeeeerrrrllllxxxxssssiiii....cccc)
  37.  
  38.            ----oooo SSSSTTTTDDDDOOOOUUUUTTTT will print to STDOUT.
  39.  
  40.            ----ssssttttdddd (Write code    for extensions that are    linked with
  41.            the current Perl.)
  42.  
  43.            Any additional arguments    are expected to    be names of
  44.            modules to generate code    for.
  45.  
  46.            When invoked with parameters the    following are accepted
  47.            and optional:
  48.  
  49.            xsinit($filename,$std,[@modules])
  50.  
  51.            Where,
  52.  
  53.            $$$$ffffiiiilllleeeennnnaaaammmmeeee is equivalent to the ----oooo option.
  54.  
  55.            $$$$ssssttttdddd is boolean,    equivalent to the ----ssssttttdddd option.
  56.  
  57.            [[[[@@@@mmmmoooodddduuuulllleeeessss]]]] is an    array ref, same    as additional
  58.            arguments mentioned above.
  59.  
  60.  
  61.  
  62.  
  63.      Page 1                        (printed 10/23/98)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222EEEE))))xxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))
  71.  
  72.  
  73.  
  74.       Examples
  75.  
  76.         perl -MExtUtils::Embed -e xsinit -- -o xsinit.c    Socket
  77.  
  78.            This will generate code with an xxxxssss____iiiinnnniiiitttt function    that
  79.            glues the perl SSSSoooocccckkkkeeeetttt::::::::bbbboooooooottttssssttttrrrraaaapppp    function to the    C
  80.            bbbbooooooootttt____SSSSoooocccckkkkeeeetttt function and    writes it to a file named
  81.            "xsinit.c".
  82.  
  83.            Note that DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr is a special case where it must
  84.            call bbbbooooooootttt____DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr directly.
  85.  
  86.         perl -MExtUtils::Embed -e xsinit
  87.  
  88.            This will generate code for linking with    DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr and
  89.            each static extension found in $$$$CCCCoooonnnnffffiiiigggg{{{{ssssttttaaaattttiiiicccc____eeeexxxxtttt}}}}.
  90.            The code    is written to the default file name ppppeeeerrrrllllxxxxssssiiii....cccc.
  91.  
  92.         perl -MExtUtils::Embed -e xsinit -- -o xsinit.c    -std DBI DBD::Oracle
  93.  
  94.            Here, code is written for all the currently linked
  95.            extensions along    with code for DDDDBBBBIIII and DDDDBBBBDDDD::::::::OOOOrrrraaaacccclllleeee.
  96.  
  97.            If you have a working DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr    then there is rarely
  98.            any need    to statically link in any other    extensions.
  99.  
  100.       ldopts()
  101.            Output arguments    for linking the    Perl library and
  102.            extensions to your application.
  103.  
  104.            When invoked as `perl -MExtUtils::Embed -e ldopts --`
  105.            the following options are recognized:
  106.  
  107.            ----ssssttttdddd
  108.  
  109.            Output arguments    for linking the    Perl library and any
  110.            extensions linked with the current Perl.
  111.  
  112.            ----IIII <path1:path2>
  113.  
  114.            Search path for ModuleName.a archives. Default path is
  115.            @@@@IIIINNNNCCCC.  Library archives are expected to be found    as
  116.            ////ssssoooommmmeeee////ppppaaaatttthhhh////aaaauuuuttttoooo////MMMMoooodddduuuulllleeeeNNNNaaaammmmeeee////MMMMoooodddduuuulllleeeeNNNNaaaammmmeeee....aaaa For example,
  117.            when looking for    SSSSoooocccckkkkeeeetttt....aaaa relative to a search path, we
  118.            should find aaaauuuuttttoooo////SSSSoooocccckkkkeeeetttt////SSSSoooocccckkkkeeeetttt....aaaa
  119.  
  120.            When looking for    DDDDBBBBDDDD::::::::OOOOrrrraaaacccclllleeee relative to    a search path,
  121.            we should find aaaauuuuttttoooo////DDDDBBBBDDDD////OOOOrrrraaaacccclllleeee////OOOOrrrraaaacccclllleeee....aaaa
  122.  
  123.            Keep in mind, you can always supply
  124.            ////mmmmyyyy////oooowwwwnnnn////ppppaaaatttthhhh////MMMMoooodddduuuulllleeeeNNNNaaaammmmeeee....aaaa as an additional linker
  125.            argument.
  126.  
  127.  
  128.  
  129.      Page 2                        (printed 10/23/98)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222EEEE))))xxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))
  137.  
  138.  
  139.  
  140.            --------  <list of linker args>
  141.  
  142.            Additional linker arguments to be considered.
  143.  
  144.            Any additional arguments    found before the -------- token are
  145.            expected    to be names of modules to generate code    for.
  146.  
  147.            When invoked with parameters the    following are accepted
  148.            and optional:
  149.  
  150.            ldopts($std,[@modules],[@link_args],$path)
  151.  
  152.            Where,
  153.  
  154.            $$$$ssssttttdddd is boolean,    equivalent to the ----ssssttttdddd option.
  155.  
  156.            [[[[@@@@mmmmoooodddduuuulllleeeessss]]]] is equivalent    to additional arguments    found
  157.            before the -------- token.
  158.  
  159.            [[[[@@@@lllliiiinnnnkkkk____aaaarrrrggggssss]]]] is equivalent to arguments found after the
  160.            -------- token.
  161.  
  162.            $$$$ppppaaaatttthhhh is    equivalent to the ----IIII option.
  163.  
  164.            In addition, when ldopts    is called with parameters, it
  165.            will return the argument    string rather than print it to
  166.            STDOUT.
  167.  
  168.       Examples
  169.  
  170.         perl -MExtUtils::Embed -e ldopts
  171.  
  172.            This will print arguments for linking with lllliiiibbbbppppeeeerrrrllll....aaaa,
  173.            DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr and extensions found in $$$$CCCCoooonnnnffffiiiigggg{{{{ssssttttaaaattttiiiicccc____eeeexxxxtttt}}}}.
  174.            This includes libraries found in    $$$$CCCCoooonnnnffffiiiigggg{{{{lllliiiibbbbssss}}}} and the
  175.            first ModuleName.a library for each extension that is
  176.            found by    searching @@@@IIIINNNNCCCC or the path specifed by the ----IIII
  177.            option. In addition, when ModuleName.a is found,
  178.            additional linker arguments are picked up from the
  179.            eeeexxxxttttrrrraaaalllliiiibbbbssss....lllldddd file in the    same directory.
  180.  
  181.         perl -MExtUtils::Embed -e ldopts -- -std Socket
  182.  
  183.            This will do the    same as    the above example, along with
  184.            printing    additional arguments for linking with the
  185.            SSSSoooocccckkkkeeeetttt extension.
  186.  
  187.         perl -MExtUtils::Embed -e ldopts -- DynaLoader
  188.  
  189.            This will print arguments for linking with just the
  190.            DDDDyyyynnnnaaaaLLLLooooaaaaddddeeeerrrr extension and    lllliiiibbbbppppeeeerrrrllll....aaaa.
  191.  
  192.  
  193.  
  194.  
  195.      Page 3                        (printed 10/23/98)
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.      EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222EEEE))))xxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))
  203.  
  204.  
  205.  
  206.         perl -MExtUtils::Embed -e ldopts -- -std Msql -- -L/usr/msql/lib -lmsql
  207.  
  208.            Any arguments after the second '--' token are
  209.            additional linker arguments that    will be    examined for
  210.            potential conflict.  If there is    no conflict, the
  211.            additional arguments will be part of the    output.
  212.  
  213.       perl_inc()
  214.            For including perl header files this function simply
  215.            prints:
  216.  
  217.         -I$Config{archlibexp}/CORE
  218.  
  219.            So, rather than having to say:
  220.  
  221.         perl -MConfig -e 'print    "-I$Config{archlibexp}/CORE"'
  222.  
  223.            Just say:
  224.  
  225.         perl -MExtUtils::Embed -e perl_inc
  226.  
  227.  
  228.       ccflags(), ccdlflags()
  229.            These functions simply print $Config{ccflags} and
  230.            $Config{ccdlflags}
  231.  
  232.       ccopts()
  233.            This function combines _p_e_r_l__i_n_c(), _c_c_f_l_a_g_s() and
  234.            _c_c_d_l_f_l_a_g_s() into    one.
  235.  
  236.       xsi_header()
  237.            This function simply returns a string defining the same
  238.            EEEEXXXXTTTTEEEERRRRNNNN____CCCC    macro as ppppeeeerrrrllllmmmmaaaaiiiinnnn....cccc along with #including
  239.            ppppeeeerrrrllll....hhhh and EEEEXXXXTTTTEEEERRRRNNNN....hhhh.
  240.  
  241.       xsi_protos(@modules)
  242.            This function returns a string of bbbbooooooootttt____$$$$MMMMoooodddduuuulllleeeeNNNNaaaammmmeeee
  243.            prototypes for each @modules.
  244.  
  245.       xsi_body(@modules)
  246.            This function returns a string of calls to nnnneeeewwwwXXXXSSSS(((()))) that
  247.            glue the    module bbbboooooooottttssssttttrrrraaaapppp function to bbbbooooooootttt____MMMMoooodddduuuulllleeeeNNNNaaaammmmeeee
  248.            for each    @modules.
  249.  
  250.            xxxxssssiiiinnnniiiitttt(((())))    uses the xsi_* functions to generate most of
  251.            it's code.
  252.  
  253.      EEEEXXXXAAAAMMMMPPPPLLLLEEEESSSS
  254.       For examples on how to use EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd for building
  255.       C/C++    applications with embedded perl, see the eg/ directory
  256.       and the _p_e_r_l_e_m_b_e_d manpage.
  257.  
  258.  
  259.  
  260.  
  261.      Page 4                        (printed 10/23/98)
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.      EEEExxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))22223333////JJJJuuuullll////99998888    ((((ppppeeeerrrrllll 5555....000000005555,,,, ppppaaaattttcccchhhh 00002222EEEE))))xxxxttttUUUUttttiiiillllssss::::::::EEEEmmmmbbbbeeeedddd((((3333))))
  269.  
  270.  
  271.  
  272.      SSSSEEEEEEEE AAAALLLLSSSSOOOO
  273.       the _p_e_r_l_e_m_b_e_d    manpage
  274.  
  275.      AAAAUUUUTTTTHHHHOOOORRRR
  276.       Doug MacEachern <_d_o_u_g_m@_o_s_f._o_r_g>
  277.  
  278.       Based    on ideas from Tim Bunce    <_T_i_m._B_u_n_c_e@_i_g._c_o._u_k> and
  279.       mmmmiiiinnnniiiimmmmoooodddd....ppppllll by    Andreas    Koenig <_k@_a_n_n_a._i_n-_b_e_r_l_i_n._d_e> and Tim
  280.       Bunce.
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.  
  311.  
  312.  
  313.  
  314.  
  315.  
  316.  
  317.  
  318.  
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.  
  327.      Page 5                        (printed 10/23/98)
  328.  
  329.  
  330.  
  331.